-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add example: construct guest resource #24
add example: construct guest resource #24
Conversation
nightly is needed for a few features, this file asserts nightly is being used
This is the only way to get guest resources constructed, as far as I can tell
This reverts commit 1e04e8b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating this example - I had a few small questions/comments on PR structure, but after they are addressed I will merge it :)
@@ -0,0 +1,440 @@ | |||
#[allow(dead_code)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file looks autogenerated. Should we rely on a macro to generate and include these bindings rather than including their expanded version in the repository?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the latest way of doing things with wit-bindgen-rt
, as per the cargo-component
template.
But that said, I did just try it as the wit-bindgen
way, and that works too. If you prefer the examples to be consistent with each other, we can go with:
wit_bindgen::generate!({
path: "wit/world.wit"
});
export!(Component);
//..
I'm not fussed either way, happy to commit ^^^ those change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I used the latest version of wit-bindgen
so the api is a bit different, but same effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, let's stick with this because it is simpler and wit_bindgen
also appears to be well-supported. Users concerned about compile times and dependencies can use the bindings.rs
solution in their own projects. For an example it's better to be simpler :)
@DouglasDwyer thanks for the feedback! I addressed your issues, committed them, cleaned up a couple other dead code lines, and even learned a few new things myself along the way. If you spot anything else pls let me know. |
Thanks for your contribution! |
Construct guest resource example
Value::Bool(false)
as results placeholderpub
topub(crate)
as no it's not necessaryCloses #23